# Maintainer: Bruce Zhang
# Contributor: fkxxyz <fkxxyz@163.com>

pkgname=imewlconverter-bin
_name=imewlconverter
pkgver=2.8.0
pkgrel=1
pkgdesc="一款开源免费的输入法词库转换程序"
arch=('x86_64' 'i686')
url="https://github.com/studyzy/imewlconverter"
license=('GPL3')
depends=('dotnet-runtime')
provides=('imewlconverter')
conflicts=('imewlconverter')
source=(
  "https://github.com/studyzy/imewlconverter/releases/download/v$pkgver/imewlconverter_Linux_Mac.tar.gz"
  "imewlconverter.sh"
)
noextract=('imewlconverter_Linux_Mac.tar.gz')
sha256sums=('baab38d7439fd399eced6810ddd4fb8193a064a8c39ab79313a05a579b9cfae8'
            '178946125cd27312e8de76aa7a4f15fad12d768b93cc1a1d52b9ea2a0c194c59')

prepare() {
  cd "${srcdir}"
  mkdir -p imewlconverter
  bsdtar -xvf imewlconverter_Linux_Mac.tar.gz -C imewlconverter
  rm "imewlconverter/ImeWlConverterCmd"
}

package() {
  destdir="${pkgdir}/usr/share/imewlconverter"
  install -d "${destdir}"
  cp "${srcdir}/imewlconverter/"* "${destdir}"
  install -Dm755 "$srcdir/imewlconverter.sh" "${pkgdir}/usr/bin/imewlconverter"
}
